﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BangumiWpfApp1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();           
        }

        private void actButton_Click(object sender, RoutedEventArgs e)
        {
            int startId = int.Parse(startTextBox.Text);
            int stopId = int.Parse(endTextBox.Text);

            PullView pullView = new PullView();
            pullView.setTask(startId, stopId);
            pullView.Owner = this;
            pullView.Show();
        }

        private void statButton_Click(object sender, RoutedEventArgs e)
        {

            BangumiApi bangumiApi = new BangumiApi();
            //bangumiApi.scoreStatisticsSimple();
            bangumiApi.rateTotalStatistics();
            //bangumiApi.timeStatistics();
        }

        private void scoreStatButton_Click(object sender, RoutedEventArgs e)
        {
            RateTotalScoreView rateTotalScoreView = new RateTotalScoreView();
            rateTotalScoreView.Owner = this;
            rateTotalScoreView.setType(1);
            rateTotalScoreView.Show();
        }

        private void rateTotalStatButton_Click(object sender, RoutedEventArgs e)
        {
            RateTotalScoreView rateTotalScoreView = new RateTotalScoreView();
            rateTotalScoreView.Owner = this;
            rateTotalScoreView.setType(2);
            rateTotalScoreView.Show();
        }
    }
}
